<include file="public/header"/>
<style>
    table tr th,table tr td { text-align: center}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <if condition="$Request.action eq 'hexin'">
                        <h5>核心期刊价格列表</h5>
                        <else/>
                            <h5>普刊价格列表</h5>
                    </if>

                    <div style="float: right;margin-top: -10px;">
                        <!-- <a  class="btn btn-w-m btn-info" href="{:url('index/shop/outbound')}">成衣出库</a>-->
                        <if condition="$Request.action eq 'hexin'">
                            <a  class="btn btn-w-m btn-info" href="{:url('addHexin')}">发布核心期刊</a>
                            <else/>
                         <a  class="btn btn-w-m btn-info" href="{:url('addPukan')}">发布普刊</a>
                        </if>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form action="pukan" method="post">
                            <div class="col-sm-3" style="float: right;">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入名称" name="keyword" class="input-sm form-control" value="{$keyword ?? ''}">
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                                    </span>
                                    &emsp;
                                    <span class="input-group-btn">
                                         <a href="{:url('pukan')}" class="btn btn-sm btn-warning J_menuItem">清空</a>
                                    </span>
                                </div>
                            </div>

                        </form>
                        <div class="col-sm-8">
                            <div class="input-group" >
                                 <a class="btn btn-sm btn-primary" href="#modal-form" data-toggle="modal">批量导入数据</a>
                            </div>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>类型</th>
                                <th>所属分类</th>
                                <th>名称</th>
                                <th>等级</th>
                                <th>刊期类别</th>
                                <th>主办方</th>
                                <th>收录情况</th>
                                <th>费用</th>
                                <th>字符标准</th>
                                <th>收稿方向</th>
                                <th>备注</th>
                                <th>刊期</th>
                                <th>出刊时间</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="pukanList" id="vo">
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.type}</td>
                                <td>{$vo.category}</td>
                                <td>{$vo.name}</td>
                                <td>{$vo.level}</td>
                                <td>{$vo.frequency}</td>
                                <td>{$vo.zhubanfang|mb_substr=###,0,25,'utf-8'}</td>
                                <td>{$vo.shoulu}</td>
                                <td>{$vo.price}</td>
                                <td>{$vo.number}</td>
                                <td>{$vo.shougao}</td>
                                <td>{$vo.commint}</td>
                                <td>{$vo.kanqi}</td>
                                <td>{$vo.chukan_time}</td>
                                <td>{$vo.addtime|date="Y-m-d"}</td>
                                <td>
                                    <if condition="$Request.action eq 'hexin'">
                                        <a data-toggle="modal"  href="{:url('editHexin',array('id'=>$vo.id))}" title="编辑"><span class="btn btn-xs btn-primary">编辑</span></a>
                                        <else/>
                                        <a data-toggle="modal"  href="{:url('editPukan',array('id'=>$vo.id))}" title="编辑"><span class="btn btn-xs btn-primary">编辑</span></a>
                                    </if>

                                    <a data-toggle="modal"  href="javaScript:onclick=confirmdeletedata({$vo['id']});" title="删除"><span class="btn btn-xs btn-danger">删除</span></a>
                                </td>
                            </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="pagination">
                            {$page|default=''}　
                            <!--<li class="page-item">
                                <input type="text" class="page-link" style="width: 40px;" id="pageys" placeholder="页数">
                            </li>
                            <button type="button" id="pageqd">确定</button>-->
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>


<!-- 批量导出 -->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body wrapper wrapper-content animated fadeInRight">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>批量导入数据</h5>
                            </div>

                            <div class="ibox-content">
                                <form class="form-horizontal m-t" id="signupForm" action="{:url('upload_excel')}" method="post" enctype="multipart/form-data">

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label-left">选择Excel文件：</label>
                                        <div class="col-sm-8">
                                            <!-- 真正的文件上传表单 -->
                                            <input name="file" type="file" id="thisfile"  style="display: none" />



                                                <div class="input-group">
                                                <input type="text" class="form-control" id="showname" readonly>
                                                    <span class="input-group-btn">
                                                    <button type="button" class="btn btn-primary" id="browse" onclick="makeThisfile()" >选择文件</button>
                                                    </span>
                                            </div>


                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label-left"></label>
                                        <div class="col-sm-8">
                                            <a href="/download.php?path=static/import_product.xlsx&name=import_product.xlsx"><span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 点击下载示范Excel文件</span></a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-8 col-sm-offset-3">
                                            <button class="btn btn-primary" id="edit" type="submit">提交</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="__TMPL__/public/assets/js/jquery.min.js?v=2.1.4"></script>
<script src="__TMPL__/public/assets/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__TMPL__/public/assets/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__TMPL__/public/assets/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/layer/layer.min.js"></script>
<script src="__TMPL__/public/assets/js/hplus.min.js?v=4.0.0"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/contabs.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/pace/pace.min.js"></script>
<script src="__TMPL__/public/assets/js/content.min.js"></script>
<!-- Peity -->
<script src="__TMPL__/public/assets/js/plugins/peity/jquery.peity.min.js"></script>

<!-- iCheck -->
<script src="__TMPL__/public/assets/js/plugins/iCheck/icheck.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
    //触发隐藏的file表单
    function makeThisfile(){
        $('#thisfile').click();
    }

    //file表单选中文件时,让file表单的val展示到showname这个展示框
    $('#thisfile').change(function(){
        $('#showname').val($(this).val())
    })
</script>
<script>

    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });

</script>
<script>
    function confirmdeletedata(id)
    {
        swal({
            title: "确定要删除数据?",
            text: "确认将删除该条数据!",
            type: "warning",
            showCancelButton: true,
            confirmButtonText: "确认",
            cancelButtonText: '取消',
            closeOnConfirm: false
        }, function(){
            $.post('{:url("delPukanRow")}', {'id':id}, function(data) {
                if(data.sta == -1 ){
                    swal({
                        title: "权限不足",
                        text: "",
                        type: "error"
                    });
                }else if(data.sta == 1){
                    swal({
                        title: "删除成功",
                        text: "",
                        type: "success"
                    });
                    window.location.reload();
                }else{
                    swal({
                        title: "删除失败",
                        text: "",
                        type: "error"
                    });
                }
            });
        });
    }

    function addclothes(code,id)
    {
        swal({
            title: "确定要补货吗?",
            text: "确认将提交到行政部门!",
            type: "warning",
            showCancelButton: true,
            confirmButtonText: "确认",
            cancelButtonText: '取消',
            closeOnConfirm: false
        },function(){
            $.post('{:url("index/shop/addClothesForAjax")}', {code: code,id:id}, function(data) {
                if(data.status == 1){
                    swal({ title: ""+data.msg+"",text: "",type: "success"});
                    window.location.reload();
                }else{
                    swal({ title: "申请失败",text: ""+data.msg+"",type: "error"});
                }
            });
        });
    }
</script>
</body>
</html>